<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/reset.css">
    <style>
        .box {
            width: 300px;
            height: 300px;
            position: relative;
        }

        .box img {
            width: 300px;
            height: 300px;
        }

        .box p {
            width: 300px;
            height: 300px;
            background-color: rgba(0, 0, 0, .5);
            color: red;
            text-align: center;
            line-height: 300px;


            position: absolute;
            bottom: 0;
            right: 0;

            height: 0;
            /* width: 0; */
            overflow: hidden;
            transition: 1s;
        }

        .box:hover p {
            height: 300px;
            /* width: 300px; */
        }
    </style>
</head>

<body>
    <div class="box">
        <img src="../images/main.jpg" alt="">
        <p>呵呵</p>
    </div>

</body>

</html>